import Layout from '../components/Layout'

const routes = [
  {
    path: '/',
    component: Layout,
    title: '首页'

  },
  {
    path: '/article',
    component: Layout,
    redirect: '/article/details/0',
    children: [
      {
        path: 'details/:id',
        name: 'article',
        title: '文章详情',
        component: () => import('../views/details')
      }
    ]
  },
  {
    path: '/login',
    component: () => import('../views/login'),
    // component: () => import('../views/register'),
    meta: {
      title: '登录',
      icon: ''
    }
  },
  {
    path: '/register',
    // component: () => import('../views/login'),
    component: () => import('../views/register'),
    meta: {
      title: '注册',
      icon: ''
    }
  },
  {
    path: '/about',
    name: 'About',
    component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')

  },
  {
    path: '*',
    component: () => import('../views/error/404')
  }
]

export default routes
